#!/usr/bin/python
# -*- coding: UTF-8 -*-

from kpautos.engine.case import Case
from kptest.config.enum import DeviceType, HostType, DeviceUtility


class BMC_IPMI_001(Case):
    """
        Name:
            BMC_IPMI_001
        Label:
            IPMI命令可以正确显示FRU信息
        PreCondition:
            1、BMC正常运行
        TestStep:
            1. 执行“ipmitool fru print”读取FRU信息
            2. 查看ipmitool返回值，有结果A）
        ExpectedResult:
            A) FRU信息显示正确
        Parameters:

        Remark:

    """

    # 测试执行前配置等准备操作
    def pre_test_case(self):
        self.device_dut = self.resource.get_device(device_type=DeviceType.Server, utility=DeviceUtility.DUT)
        self.os_host = self.device_dut.get_host(host_type=HostType.HostOS)


    # 测试步骤
    def procedure(self):
        self.log_step("1、执行ipmitool fru print读取FRU信息")
        ipmi_os_fru = self.os_host.send_combination_keys('ipmitool fru print', timeout=60)
        self.log_info(ipmi_os_fru)

    # 测试结束后恢复环境
    def post_test_case(self):
        pass